--- /dev/null
+#include "defs.h"
+#include "inifile.h"
+#include "explorist_ini.h"
+
+static inifile_t *inifile;
+static const char myname[] = "explorist";
+
+const char *
+explorist_read_value(const char* section, const char *key) {
+ return inifile_readstr(inifile, section, key);
+}
+
+mag_info *
+explorist_ini_get() {
+ mag_info *info = xmalloc(sizeof(mag_info));
+ char *s;
+
+ inifile = inifile_init("Geocaches.ini", myname);
+ s = xstrdup(inifile_readstr(inifile, "Geocaches", "GeocachesPath"));
+ s = gstrsub(s, "\\", "/");
+ info->geo_path = s;
+ inifile_done(inifile);
+
+ inifile = inifile_init("Tracks.ini", myname);
+ s = xstrdup(inifile_readstr(inifile, "Tracks", "TracksExportPath"));
+ s = gstrsub(s, "\\", "/");
+ info->track_path = xstrappend(s, "/tracks.gpx");;
+ inifile_done(inifile);
+
+ inifile = inifile_init("Waypoints.ini", myname);
+ s = xstrdup(inifile_readstr(inifile, "Waypoints", "WaypointsPath"));
+ s = gstrsub(s, "\\", "/");
+ info->waypoint_path = xstrappend(s, "/newwaypoints.gpx");
+ inifile_done(inifile);
+
+ return info;
+}
+
+void
+explorist_ini_done(mag_info *info) {
+ xfree(info->geo_path);
+ xfree(info->track_path);
+ xfree(info->waypoint_path);
+ xfree(info);
+}
/*
Communicate Thales/Magellan serial protocol.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Robert Lipe, robertlipe@usa.net
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2010 Robert Lipe, robertlipe@usa.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "defs.h"
#include "magellan.h"
#include "gbser.h"
+#include "explorist_ini.h"
static int bitrate = 4800;
static int wptcmtcnt;
static int wpt_len = 8;
static const char *curfname;
static int extension_hint;
+// For Explorist GC/510/610/710 familes, bludgeon in GPX support.
+// (This has nothing to do with the Explorist 100...600 products.)
+static ff_vecs_t *gpx_vec;
+static mag_info *explorist_info;
/*
* Magellan's firmware is *horribly* slow to send the next packet after
{
char *ext;
waypoint_read_count = 0;
+ // For Explorist GC, intercept the device access and redirect to GPX.
+ // We actually do the rd_init() inside read as we may have multiple
+ // files that we have to read.
+ if (0 == strcmp(portname, "usb:")) {
+ char *vec_opts = NULL;
+ explorist_info = explorist_ini_get();
+ gpx_vec = find_vec("gpx", &vec_opts);
+ return;
+ }
if (bs) {
bitrate=atoi(bs);
static void
mag_deinit(void)
{
+ if (explorist_info) {
+ explorist_ini_done(explorist_info);
+ return;
+ }
mag_handoff();
termdeinit();
if(mkshort_handle)
static void
mag_read(void)
{
+ if (gpx_vec) {
+ gpx_vec->rd_init(explorist_info->track_path);
+ gpx_vec->read();
+ return;
+ }
+
found_done = 0;
if (global_opts.masked_objective & TRKDATAMASK) {
magrxstate = mrs_handoff;